package com.ysstech.finance.thread;

import java.util.Date;
import java.util.concurrent.Callable;

import com.ysstech.common.util.DateUtil;
import com.ysstech.finance.entity.Voucher;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;

@Slf4j
public class VoucherThread implements Callable<T> {
    private VoucherGenerateService voucherGenerateService;
    private Voucher voucher;

    public VoucherThread(VoucherGenerateService voucherGenerateService, Voucher voucher) {
        this.voucherGenerateService = voucherGenerateService;
        this.voucher = voucher;
    }

    @Override
    public T call() throws Exception {
        log.info(DateUtil.dateToStrByFormat(new Date(), "yyyy-MM-dd HH:mm:ss:SSS") + voucher.getAccountId());
        voucherGenerateService.doGenerate(voucher);
        return null;
    }
}
